<!--#include file="../nav/account_top.php" -->
<!--#include file="../nav_menu/account_begin.php" -->
<style type="text/css">

</style>
<div class="main_content_title">
	账户中心
</div>
<div class="main_content_main">
	<div style="color:#666666">
		当前账户余额：￥<span class="green f14 fb">{$balance}</span>元
		<button class="btn_blue" onclick="jumpTo('/account_pay/pay')">在线充值</button>
	</div>
	<!--账户流水表格-->
	<div class="margin10">
		<table class="billtb">
			<thead>
				<tr>
					<td style="width:80px;">类别</td>
					<td style="width:80px;">存入金额</td>
					<td style="width:80px;">支出金额</td>
					<td style="width:80px;">当前余额</td>
					<td style="width:130px;">时间</td>
					<td style=" ">备注</td>
				</tr>
			</thead>	
			<tbody id="tbnobody">
				<tr>
					<td colspan="6">
						暂无记录
					</td>
				</tr>
			</tbody>
			<tbody id="tbloading">
				<tr>
					<td colspan="6">
						<img src="/misc/images/account/loading.gif" title="正在加载" />
					</td>
				</tr>
			</tbody>	
			<tbody id="tbdata"> 
			</tbody>	
		</table>	
	</div>
	<div id="grids"></div> 
</div>
<script type="text/javascript">
var url_list   =  '/account_pay/index';
$().ready(function(){
	o2js.build('o2grid');
	/* 组装表格 */	
	grids = new o2Grid({
		bind:'grids', 
		url:url_list,
		imgpath:'/misc/vendors/o2js/o2grid/image',
		rowNum:10,
		cols:[
		],
		beforefunc:function(){
			$('#tbdata').html('').hide(); 
			$('#tbnobody').hide(); 
			$('#tbloading').show();
		},
		runfunc:function(obj){
			contactinfo = [];
			details = obj.results; 
			if(details.length == 0){
				$('#tbdata').hide();
				$('#tbloading').hide();
				$('#tbnobody').show();
			}else{
				$('#tbloading').hide();
				$('#tbnobody').hide();
				$('#tbdata').show();
			}
			fnZuZhuangData(details);
		}
	});
	grids.load(1); 
});
/* 组装联系人 */
function fnZuZhuangData(allrs){
	var html='';
	for(var i=0; i<allrs.length; i++){
		var obj = allrs[i];
		html += '<tr >';
		html += '	<td > '+obj.transtype_name+' </td>';
		if(obj.actions == '+'){
			html += '	<td class="txt_r" > '+obj.fee+' </td>';
			html += '	<td  class="txt_r" > - </td>';
		}else{
			html += '	<td  class="txt_r" > - </td>';
			html += '	<td class="txt_r" > '+obj.fee+' </td>';
		}
		html += '	<td  class="txt_r" > '+obj.balance+' </td>';
		html += '	<td class="txt_c" > '+obj.created+' </td>';
		html += '	<td class="txt_c" > '+obj.remark+' </td>';
		html += '</tr>';
	}					
	$('#tbdata').html(html);
}
</script>
<!--#include file="../nav_menu/account_end.php" -->
<!--#include file="../nav/account_bottom.php" -->